#include "Comm.hpp"

int main()
{
    key_t key = GetShmkeyOrDie();
    cout << ToHex(key) << endl;

    int shmid = GetShm(key,SIZE);
    cout << shmid << endl;

    char* addr = (char*)ShmAttach(shmid);
    cout << "addr: sucess" << endl;

    for(;;)
    {
        cout << "shm content: " << addr << endl;
        sleep(1);
    }

    sleep(5);
    ShDetach((void*)addr);
    cout << "ShDetach: sucess" << endl;
    return 0;
}



